package com.weixhh.blog.service;

import com.weixhh.blog.dao.UserRepository;
import com.weixhh.blog.po.IUser;
import com.weixhh.blog.util.MD5Utils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @description
 * @author: weiXhh
 * @create: 2020-02-29 16:41
 **/
@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserRepository userRepository;

    @Override
    public IUser checkUser(String username, String password) {

        IUser user = userRepository.findByUsernameAndPassword(username, MD5Utils.code(password));
        return user;
    }

}
